package com.awspaas.user.apps.sts.util;

import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.sdk.local.SDK;

/**
 * @Title: DbsqlUtil
 * @Package com.awspaas.user.apps.sts.Util.DbsqlUtil
 * @Description: 对业务日志表更新及插入操作辅助类（暂弃）
 * @Author zhoujianchen
 * @Email
 * @Date 2022/9/04
 */
public class DbsqlUtil {
    /**
     * 插入操作日志
     * @param processDefId
     * @param taskInstId
     * @param btnId
     * @param type
     * @param uc
     */
    public void InsertBtnLog(String processDefId, String taskInstId, String btnId, String type, UserContext uc) {
        BO bo = new BO();
        bo.set("TASKINSTID",taskInstId);
        bo.set("BUTTONID",btnId);
        bo.set("PROCESS_DEF_ID",processDefId);
        bo.set("BUTTONTYPE",type);
        SDK.getBOAPI().createDataBO("BO_PS_INTERMEDIATE_LOG",bo,uc);
    }
    /**
     * 更新操作日志
     * @param processDefId
     * @param taskInstId
     * @param btnId
     * @param type
     * @param uc
     */
    public void UpdateBtnLog(String processDefId, String taskInstId, String btnId, String type, UserContext uc) {
      BO bo = SDK.getBOAPI().query("BO_PS_INTERMEDIATE_LOG").addQuery("TASKINSTID=",taskInstId).addQuery("BUTTONID=",btnId).detail();
      bo.set("BUTTONSTATUS","");
      SDK.getBOAPI().update("BO_PS_INTERMEDIATE_LOG",bo);
    }
}
